//
//  myQuestListModel.m
//  YuTang
//
//  Created by 葛悦彣 on 2024/8/6.
//

#import "myQuestListModel.h"

@implementation myQuestListModel
+ (NSDictionary *)modelCustomPropertyMapper {
    return @{
        @"ID":@[@"id"],
        @"Description":@[@"description"],
    };
}


-(CGFloat)DescriptionStrH{
    if(_DescriptionStrH == 0){
        _DescriptionStrH = [DTKTool textWithtitle:[NSString stringWithFormat:@"任务说明: %@", self.Description] andSize:CGSizeMake(kwt(330), 10000) andFout:kFont(16)].height;
        if(_DescriptionStrH < kwt(20)){
            _DescriptionStrH = kwt(20);
        }
    }
    return _DescriptionStrH;
}
- (CGFloat)cellH{
    
    if(self.state == 2){///完成时
        return kwt(80 + 15) + self.DescriptionStrH;
    } else {
        return kwt(80 + 69) + self.DescriptionStrH;

    }
}
@end

@implementation myQuestTimeListModel
+ (NSDictionary *)modelContainerPropertyGenericClass {
    return @{
        @"taskTimeList":[myQuestTaskTimeListModel class],
    };
}
- (NSInteger)stateWithTime:(NSString *)time {
    for (myQuestTaskTimeListModel * model in self.taskTimeList) {
        if([model.executeTime isEqualToString:time]){
            return model.state;
        }
    }
    return 0;
}
@end
@implementation myQuestTaskTimeListModel

@end
